<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
      xmlns:p="http://primefaces.org/ui">

    <body>

        <ui:composition template="./Template/Template3.xhtml">

            <ui:define name="top">
                top
            </ui:define>

            <ui:define name="content">
                <f:view>
                    <p:panel header="Realizar Pago" toggleable="true">
                    <h:form>
                       
                        <p:growl life="3000"/>
                        <p:panelGrid columns="2">
                         <h:outputLabel value="Dias Trabajados:" for="daysWorked" />
                         <p:inputText id="daysWorked" value="#{payBean.pay.daysWorked}" title="DaysWorked" required="true" requiredMessage="The Name field is required." validatorMessage="hola" >
                             <f:validateRegex pattern="[0-7]{1}"/>   
                          
                            </p:inputText>
                          
                            
                            <h:outputLabel value="Horas a la semana:" for="hoursWorked" />
                            <p:inputText id="hoursWorked" value="#{payBean.pay.hoursWorked}" title="HoursWorked" required="true" requiredMessage="The Name field is required." />
                          
                            
                            <h:outputLabel value="Tiempo extra a la semana:" for="overTime" required="true" requiredMessage="The Name field is required." />
                            <p:inputText id="overTime" value="#{payBean.pay.overTime}" title="OverTime" />
                           
                            
                            <h:outputLabel value="Pago:" for="pay" />
                            <p:inputText id="pay" value="#{payBean.pay.pay}" title="Pay" required="true" requiredMessage="The Name field is required." />
                            <h:outputLabel value="Trabajador:" for="staffIdstaff" />
                            
                            
                            <h:selectOneMenu id="staffIdstaff" value="#{payBean.idStaffSeleccionado}" title="StaffIdstaff" >
                                <!-- TODO: update below reference to list of available items-->
                                <f:selectItems value="#{payBean.listaStaff}"  var="item" itemValue="#{item.idstaff}" itemLabel="#{item.name} #{item.firstName} #{item.lastName}"/>
                            </h:selectOneMenu>
                            <p:commandButton action="#{payBean.prepararPago()}" value="Aceptar"/>
                            <p:commandButton action="Pago" value="Cancelar" immediate="true"/>
                        </p:panelGrid>
                    </h:form>
                    </p:panel>
                </f:view>

            </ui:define>

            <ui:define name="bottom">
                
            </ui:define>

        </ui:composition>

    </body>
</html>
